package com.yx1996.day_01;

import com.yx1996.domain.Customer;
import com.yx1996.utils.HibernateUtils;
import org.hibernate.Session;
import org.hibernate.Transaction;
import org.junit.Test;

public class test {
    @Test
    public void TestSave(){
        Session session = HibernateUtils.openSession();
        Transaction transaction = session.beginTransaction();
        Customer customer = session.get(Customer.class, 10l);
        customer.setCust_name("张三吧去去去");
        session.save(customer);
        transaction.commit();
        session.close();
    }
}
